package com.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.health.pojo.Setmeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface SetmealMapper extends BaseMapper<Setmeal> {

    /**
     * 套餐统计
     *
     * @return
     */
    @Select("select t2.name name, count(*) value from t_order t1, t_setmeal t2 where t1.setmeal_id = t2.id group by t2.name")
    List<Map<String, Object>> getSetmealReportData();

}
